<template>
	<view class="contenting">
		<!-- <Search></Search>
		<Preference></Preference>
		<Title></Title> -->
		<!-- <view @click="poll()">
			<Delicacy id="boxFixed" :class="{'is_fixed' : isfixed}"></Delicacy>
		</view> -->
		<Takeout @tiaozhuan="tiaozhuan"></Takeout>
			<view v-if="false">
				<!-- 静态样式 -->
				<!-- 打开弹窗 -->
				<view style="padding: 200upx 15%;">
					<button type="primary" @tap="showBanner">打开弹窗</button>
				</view>
				
				<!-- 弹出层 -->
				<view  class="uni-banner" style="background:#FFFFFF;" v-if="bannerShow">
					<!-- x -->
					<view style=" text-align:right;padding:20upx;border: 1upx solid;" @tap="closeBanner">
						<text>x</text>
					</view>
					<!-- 图 -->
					<view>
						<image src="https://img-cdn-qiniu.dcloud.net.cn/uniapp/images/shuijiao.jpg" mode="widthFix" style="width:100%;"></image>
					</view>
					<!-- 按钮键 -->
					<view style="margin:50upx 0; margin-bottom:68upx;" >
					    <button type='warn' style="background:#F6644D; margin:0 80upx;">一个按钮</button>
					</view>
				</view>
				
				<!-- 做黑色阴影颜色 -->
				<!-- <view class="uni-mask" v-if="bannerShow">uni-mask</view> -->
				<view class="uni-mask" v-if="true">uni-mask</view>
				<!-- 弹出层 -->
			</view>
	</view>
</template>

<script>
	// 引进子组件
	import Search from './components/search.vue'
	import Preference from './components/preference.vue'
	import Title from './components/title.vue'
	import Delicacy from './components/delicacy.vue'
	import Takeout from './components/takeout.vue'
	export default {
		components: {
			Search,
			Preference,
			Title,
			Delicacy,
			Takeout
		},
		data() {
			return {
				rect: '',
				menutop: '',
				topdata: '',
				isfixed: false,
				bannerShow:true
			}
		},
		/* onBackPress() {
			if(this.bannerShow){
				this.bannerShow = false;
				return true;
			}
			console.log('onBackPress')
		}, */
		methods: {
			tiaozhuan(){
				console.log('tiaozhuan')
			},
			
			closeBanner:function(){
				this.bannerShow=false;
			},
			showBanner:function(){
				this.bannerShow=true;
			},
		},
		onLoad() {
			
		},
		
	}
</script>

<style scoped lang="scss">
	.contenting {
		margin: 0 15upx;
	}
	.is_fixed {
		position: fixed;
		left: 0;
		top: 0;
		right: 0;
	}
		/* 弹出层形式的广告 */
		.uni-banner {
			width: 70%;
			position: fixed;
			left: 15%;
			margin-top: -400upx;
			z-index: 99;
		}
		.uni-mask{
			//  z-index: 1;
			// background: rgba(0, 0, 0, 0.6);
		}
</style>
